// 在api里面引入axios
import axios from "@/request/request";
import qs from "qs";
// 获取精品有推荐数据
export const JingpinAPI = () => axios.get("/products/recommend");

// 获取热门数据
export const RemenAPI = () => axios.get("/products/hot");

// 发送短信验证码  params={}
export const SendSMSAPI = (params) =>
  axios.post("/sendSMS", qs.stringify(params));

//登录请求  去到接口文档查找对应的接口
export const PhoneReginAPI = (params) =>
  axios.post("/phoneRegin", qs.stringify(params));

// 查看序列化
// console.log("序列化:",qs.stringify({a:10,b:100}));

// 微信扫码登录
export const WeiXinLoginAPI = (params) =>
  axios.post("/wechatUsers/PCLogin", qs.stringify(params));

//手机号绑定微信
export const BandingAPI = (params) =>
  axios.post("/wechatUsers/binding", qs.stringify(params));

// 获取用户信息 不需要传参
export const UserProdilesAPI = () => axios.get("/shop/userProfiles");

// 请求产品详细请信息[地址参数]
export const GoodDetailsAPI = (params) => axios.get(`/products/${params}`);

//加入购物车 AddToCartsAPI
export const AddToCartsAPI = (params) =>
  axios.post("/shop/carts/add", qs.stringify(params));

// 获取所有产品请求体
export const GoodsSearchAPI = (params) => axios.get("/products", { params });

// 请求个人中心里面的购物车部分渲染
// 请求购物车数据
export const CartDataAPI = () => axios.get(`/shop/carts`);
